<?php
class Socialprofiles_Model_Socialprofiles implements Socialprofiles_Model_Mainable {
    
    private $socialprofiles_data_getsocialprofilesdata;
    private $core_controller_csrftoken;
    private $socialprofiles_model_pagedecision;
    
    public function main(array $variables = null) {
        if(isset($variables['get']['page'])){
            $this->socialprofiles_model_pagedecision = new Socialprofiles_Model_Pagedecision;
            return $this->socialprofiles_model_pagedecision->main($variables);
        }
        else {
            $this->core_controller_csrftoken = new Core_Controller_Csrftoken;
            $this->socialprofiles_data_getsocialprofilesdata = new Socialprofiles_Data_Getsocialprofilesdata;
            
            $page['csrf_token'] = $this->core_controller_csrftoken->main($variables);
            $page['content'] = $this->socialprofiles_data_getsocialprofilesdata->main($variables);
            $page['template'] = WEB_ROOT_FOLDER."socialprofiles/views/socialprofile.php";
            
            return $page;
        }
    }

}
